package com.pactera.asmp.server.controller.trace;

import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.pactera.asmp.server.common.constants.PermissionCode;
import com.pactera.asmp.server.common.constants.ResultCode;
import com.pactera.asmp.server.common.logprint.utils.CollectionUtils;
import com.pactera.asmp.server.common.logprint.utils.StringUtils;
import com.pactera.asmp.server.entity.IssueSearchDTO;
import com.pactera.asmp.server.entity.PieChartVO;
import com.pactera.asmp.server.entity.ResponseResult;
import com.pactera.asmp.server.pojo.PieChart;
import com.pactera.asmp.server.service.IssueService;
import com.pactera.asmp.server.utils.PageDataResult;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.List;

/**
 * @ProjectName: asmpserver
 * @Package: com.pactera.asmp.server.controller.issue
 * @ClassName: IssueController
 * @Author: lvzhiqiang
 * @Description: Issue业务控制类
 * @Date: 2019/8/2 14:52
 * @Version: 1.0
 */
@Controller
@RequestMapping("/api/v1/issue")
public class IssueController {
    private static final Logger logger = LoggerFactory
            .getLogger(IssueController.class);

    @Autowired
    private IssueService mIssueService;


    /**
     * @Method PageDataResult
     * @Description PageDataResult
     * @param:
     * @return:
     * @auther: lzq
     * @date: 2019/8/2 14:56
     */
    /**
     * @api {post} /issue/getIssues getIssues
     * @apiDescription 查找所有问题
     * @apiName getIssues
     * @apiGroup Issue manage
     * @apiParamExample {json} Request-Example:
     * {
     * 	id: 9
     * }
     * @apiSuccessExample Success-Response:
     * {
     * {"totals":90,
     * "list":
     * [{"id":100,
     * "page":null,
     * "limit":null,
     * "issueType":"data_app_anr",
     * "issueProcessName":"com.pactera.test.demo",
     * "vinCode":"LZAAAAAAAAAAAAAA",
     * "projectName":"GEM-K257-GEM升级项目",
     * "deviceVersion":"Delphi 23.24.01.22",
     * "issueCreateTime":"2019-09-27 13:36:40.0",
     * "issueCreateTimeEnd":null,
     * "issueUploadTime":"2019-09-27 13:36:45.0",
     * "issueDescription":"Process: com.pactera.test.demo\nFlags: 0x38c8bf46\nPackage: com.pactera.test.demo v1 (1.0)\nActivity: com.pactera.test.demo/.MainActivity\nSubject: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago.  Wait queue length: 4.  Wait queue head age: 5586.4ms.)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\n\nCPU usage from 351596ms to 0ms ago:\n  14% 2331/perfd: 2% user + 12% kernel / faults: 31233 minor\n  11% 1637/system_server: 4.7% user + 6.3% kernel / faults: 15117 minor\n  7.7% 1241/adbd: 0.1% user + 7.5% kernel / faults: 62042 minor\n  2.6% 1224/surfaceflinger: 0.1% user + 2.5% kernel\n  0.5% 3/ksoftirqd/0: 0% user + 0.5% kernel\n  0.3% 12/ksoftirqd/1: 0% user + 0.3% kernel\n  0.3% 8/rcu_preempt: 0% user + 0.3% kernel\n  0.2% 1232/mediaserver: 0% user + 0.2% kernel / faults: 4 minor\n  0.2% 11/migration/1: 0% user + 0.2% kernel\n  0.1% 19870/kworker/u4:1: 0% user + 0.1% kernel\n  0.1% 26765/kworker/u4:0: 0% user + 0.1% kernel\n  0.1% 7/migration/0: 0% user + 0.1% kernel\n  0.1% 1950/com.android.phone: 0% user + 0.1% kernel / faults: 6 minor\n  0.1% 1223/servicemanager: 0% user + 0.1% kernel\n  0.1% 1964/com.android.launcher3: 0% user + 0% kernel / faults: 378 minor\n  0% 1747/com.android.systemui: 0% user + 0% kernel / faults: 14 minor\n  0% 1221/healthd: 0% user + 0% kernel\n  0% 2624/kworker/1:2: 0% user + 0% kernel\n  0% 31083/kworker/0:0: 0% user + 0% kernel\n  0% 1211/logd: 0% user + 0% kernel / faults: 6 minor\n  0% 1230/rild: 0% user + 0% kernel\n  0% 1240/fingerprintd: 0% user + 0% kernel\n  0% 1228/netd: 0% user + 0% kernel / faults: 15 minor\n  0% 1242/logcat: 0% user + 0% kernel\n  0% 1897/com.android.inputmethod.latin: 0% user + 0% kernel / faults: 1 minor\n +0% 2140/com.pactera.test.demo: 0% user + 0% kernel\n27% TOTAL: 6% user + 20% kernel + 0% irq + 0.9% softirq\n\n----- pid 2140 at 2019-09-27 05:36:37 -----\nCmd line: com.pactera.test.demo\nBuild fingerprint: 'Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys'\nABI: 'x86'\nBuild type: optimized\nZygote loaded classes=3978 post zygote classes=258\nIntern ","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.pactera.test.demo/1569562600196/data_app_anr@1569562599689.txt"},{"id":99,"page":null,"limit":null,"issueType":"data_app_crash","issueProcessName":"com.pactera.test.demo","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 13:28:12.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 13:28:17.0","issueDescription":"Process: com.pactera.test.demo\nFlags: 0x38c8bf46\nPackage: com.pactera.test.demo v1 (1.0)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\n\njava.lang.IllegalStateException: Could not execute method for android:onClick\n\tat android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)\n\tat android.view.View.performClick(View.java:5198)\n\tat android.view.View$PerformClick.run(View.java:21147)\n\tat android.os.Handler.handleCallback(Handler.java:739)\n\tat android.os.Handler.dispatchMessage(Handler.java:95)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\nCaused by: java.lang.reflect.InvocationTargetException\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)\n\t... 9 more\nCaused by: java.lang.ArithmeticException: divide by zero\n\tat com.pactera.test.demo.MainActivity.onClickFunction(MainActivity.java:44)\n\t... 11 more\n","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.pactera.test.demo/1569562092230/data_app_crash@1569562090974.txt"},{"id":98,"page":null,"limit":null,"issueType":"data_app_crash","issueProcessName":"com.pactera.test.demo","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:18:08.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:18:10.0","issueDescription":"Process: com.pactera.test.demo\nFlags: 0x38c8bf46\nPackage: com.pactera.test.demo v1 (1.0)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\n\njava.lang.IllegalStateException: Could not execute method for android:onClick\n\tat android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)\n\tat android.view.View.performClick(View.java:5198)\n\tat android.view.View$PerformClick.run(View.java:21147)\n\tat android.os.Handler.handleCallback(Handler.java:739)\n\tat android.os.Handler.dispatchMessage(Handler.java:95)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\nCaused by: java.lang.reflect.InvocationTargetException\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)\n\t... 9 more\nCaused by: java.lang.ArithmeticException: divide by zero\n\tat com.pactera.test.demo.MainActivity.onClickFunction(MainActivity.java:44)\n\t... 11 more\n","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.pactera.test.demo/1569557888135/data_app_crash@1569557886817.txt"},{"id":97,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.settings","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:16:59.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:17:00.0","issueDescription":"Process: com.android.settings\nFlags: 0x30c83e45\nPackage: com.android.settings v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 137843\nLoop-Violation-Number: 1\nDuration-Millis: 726\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=2621447 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)\n\tat java.io.File.doAccess(File.java:281)\n\tat java.io.File.exists(File.java:361)\n\tat android.app.ContextImpl.createFilesDirLocked(ContextImpl.java:418)\n\tat android.app.ContextImpl.getFilesDir(ContextImpl.java:441)\n\tat android.content.ContextWrapper.getFilesDir(ContextWrapper.java:203)\n\tat com.android.settings.Utils.isLowStorage(Utils.java:1077)\n\tat com.android.settings.SettingsActivity.onCreate(SettingsActivity.java:589)\n\tat android.app.Activity.performCreate(Activity.java:6237)\n\tat android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)\n\tat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)\n\tat android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)\n\tat android.app.ActivityThread.-wrap11(ActivityThread.java)\n\tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\n\nProcess: com.android.settings\nFlags: 0x30c83e45\nPackage: com.android.settings v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 137844\nLoop-Violation-Number: 2\nDuration-Millis: 725\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=2621447 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.statvfs(BlockGuardOs.java:297)\n\tat java.io.F","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.settings/1569557818965/system_app_strictmode@1569557818444.txt"},{"id":96,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.systemui","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:16:12.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:16:13.0","issueDescription":"Process: com.android.systemui\nFlags: 0x38c83e0d\nPackage: com.android.systemui v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 91263\nLoop-Violation-Number: 1\nDuration-Millis: 584\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=6815751 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)\n\tat java.io.File.doAccess(File.java:281)\n\tat java.io.File.exists(File.java:361)\n\tat com.android.server.wallpaper.WallpaperManagerService.getWallpaper(WallpaperManagerService.java:828)\n\tat android.app.IWallpaperManager$Stub.onTransact(IWallpaperManager.java:101)\n\tat android.os.Binder.execTransact(Binder.java:453)\n# via Binder call with stack:\nandroid.os.StrictMode$LogStackTrace\n\tat android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1911)\n\tat android.os.Parcel.readExceptionCode(Parcel.java:1580)\n\tat android.os.Parcel.readException(Parcel.java:1549)\n\tat android.app.IWallpaperManager$Stub$Proxy.getWallpaper(IWallpaperManager.java:328)\n\tat android.app.WallpaperManager$Globals.getCurrentWallpaperLocked(WallpaperManager.java:303)\n\tat android.app.WallpaperManager$Globals.peekWallpaperBitmap(WallpaperManager.java:272)\n\tat android.app.WallpaperManager.getBitmap(WallpaperManager.java:623)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.updateWallpaperLocked(ImageWallpaper.java:428)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.drawFrame(ImageWallpaper.java:349)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.onSurfaceRedrawNeeded(ImageWallpaper.java:299)\n\tat android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:800)\n\tat android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:1196)\n\tat com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:37)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\n\n","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.systemui/1569557772154/system_app_strictmode@1569557771717.txt"},{"id":95,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.providers.telephony","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:16:01.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:16:02.0","issueDescription":"Process: com.android.phone\nFlags: 0x38c83e4d\nPackage: com.android.providers.telephony v23 (6.0-4174734)\nPackage: com.android.phone v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 81144\nLoop-Violation-Number: 1\nBroadcast-Intent-Action: android.telephony.action.CARRIER_CONFIG_CHANGED\nDuration-Millis: 29\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=2621447 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)\n\tat java.io.File.doAccess(File.java:281)\n\tat java.io.File.exists(File.java:361)\n\tat android.app.SharedPreferencesImpl.writeToFile(SharedPreferencesImpl.java:570)\n\tat android.app.SharedPreferencesImpl.-wrap2(SharedPreferencesImpl.java)\n\tat android.app.SharedPreferencesImpl$2.run(SharedPreferencesImpl.java:515)\n\tat android.app.SharedPreferencesImpl.enqueueDiskWrite(SharedPreferencesImpl.java:536)\n\tat android.app.SharedPreferencesImpl.-wrap0(SharedPreferencesImpl.java)\n\tat android.app.SharedPreferencesImpl$EditorImpl.commit(SharedPreferencesImpl.java:458)\n\tat com.android.phone.settings.VisualVoicemailSettingsUtil.setVisualVoicemailEnabled(VisualVoicemailSettingsUtil.java:68)\n\tat com.android.phone.vvm.omtp.SimChangeReceiver.onReceive(SimChangeReceiver.java:87)\n\tat android.app.ActivityThread.handleReceiver(ActivityThread.java:2725)\n\tat android.app.ActivityThread.-wrap14(ActivityThread.java)\n\tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\n\nProcess: com.android.phone\nFlags: 0x38c83e4d\nPackage: com.android.providers.telephony v23 (6.0-4174734)\nPackage: com.android.phone v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Mil","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.providers.telephony/1569557761117/system_app_strictmode@1569557760589.txt"},{"id":94,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.deskclock","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:15:54.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:15:57.0","issueDescription":"Process: com.android.deskclock\nFlags: 0x3cc9be45\nPackage: com.android.deskclock v410 (4.1.0)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 75982\nLoop-Violation-Number: 1\nBroadcast-Intent-Action: android.intent.action.BOOT_COMPLETED\nDuration-Millis: 148\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=2621447 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)\n\tat java.io.File.doAccess(File.java:281)\n\tat java.io.File.exists(File.java:361)\n\tat android.app.SharedPreferencesImpl.writeToFile(SharedPreferencesImpl.java:570)\n\tat android.app.SharedPreferencesImpl.-wrap2(SharedPreferencesImpl.java)\n\tat android.app.SharedPreferencesImpl$2.run(SharedPreferencesImpl.java:515)\n\tat android.app.SharedPreferencesImpl.enqueueDiskWrite(SharedPreferencesImpl.java:536)\n\tat android.app.SharedPreferencesImpl.-wrap0(SharedPreferencesImpl.java)\n\tat android.app.SharedPreferencesImpl$EditorImpl.commit(SharedPreferencesImpl.java:458)\n\tat com.android.deskclock.alarms.AlarmStateManager.updateGlobalIntentId(AlarmStateManager.java:168)\n\tat com.android.deskclock.AlarmInitReceiver.onReceive(AlarmInitReceiver.java:57)\n\tat android.app.ActivityThread.handleReceiver(ActivityThread.java:2725)\n\tat android.app.ActivityThread.-wrap14(ActivityThread.java)\n\tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\n\nProcess: com.android.deskclock\nFlags: 0x3cc9be45\nPackage: com.android.deskclock v410 (4.1.0)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 75987\nLoop-Violation-Number: 2\nBroadcast-Intent-Action: android.intent.action.BOOT_COMPLETED\nDuration-Millis: 143\n\nandroid.os.StrictMode$StrictM","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.deskclock/1569557754489/system_app_strictmode@1569557753847.txt"},{"id":93,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.providers.telephony","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:15:52.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:15:55.0","issueDescription":"Process: com.android.phone\nFlags: 0x38c83e4d\nPackage: com.android.providers.telephony v23 (6.0-4174734)\nPackage: com.android.phone v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 74326\nLoop-Violation-Number: 1\nDuration-Millis: 130\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=2621447 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat android.database.sqlite.SQLiteConnection.applyBlockGuardPolicy(SQLiteConnection.java:1039)\n\tat android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:840)\n\tat android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)\n\tat android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)\n\tat android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:143)\n\tat android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132)\n\tat android.content.ContentResolver.query(ContentResolver.java:510)\n\tat android.content.ContentResolver.query(ContentResolver.java:434)\n\tat com.android.internal.telephony.SubscriptionController.getSubInfo(SubscriptionController.java:332)\n\tat com.android.internal.telephony.SubscriptionController.getActiveSubscriptionInfoList(SubscriptionController.java:556)\n\tat com.android.internal.telephony.SubscriptionController.getActiveSubscriptionInfo(SubscriptionController.java:401)\n\tat android.telephony.SubscriptionManager.getActiveSubscriptionInfo(SubscriptionManager.java:476)\n\tat com.android.services.telephony.TelecomAccountRegistry$AccountEntry.registerPstnPhoneAccount(TelecomAccountRegistry.java:120)\n\tat com.android.services.telephony.TelecomAccountRegistry$AccountEntry.<init>(TelecomAccountRegistry.java:75)\n\tat com.android.services.telephony.TelecomAccountRegistry.setupAccounts(TelecomAccountRegistry.java:399)\n\tat com.android.services.telephony.TelecomAccountRegistry.-wrap0(TelecomAccountRegistry.java)\n\tat com.android.services.telephony.TelecomAccountRegistry$1.onSubscriptionsChanged(TelecomAccountRegistry.java:271)\n\tat android.telephony.SubscriptionManager$OnSubscriptionsChangedListener$1.handleMessage(Subsc","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.providers.telephony/1569557751554/system_app_strictmode@1569557750689.txt"},{"id":92,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.systemui","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-26 16:55:38.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-26 16:55:48.0","issueDescription":"Process: com.android.systemui\nFlags: 0x38c83e0d\nPackage: com.android.systemui v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 1386908\nLoop-Violation-Number: 1\nDuration-Millis: 532\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=6815751 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)\n\tat java.io.File.doAccess(File.java:281)\n\tat java.io.File.exists(File.java:361)\n\tat com.android.server.wallpaper.WallpaperManagerService.getWallpaper(WallpaperManagerService.java:828)\n\tat android.app.IWallpaperManager$Stub.onTransact(IWallpaperManager.java:101)\n\tat android.os.Binder.execTransact(Binder.java:453)\n# via Binder call with stack:\nandroid.os.StrictMode$LogStackTrace\n\tat android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1911)\n\tat android.os.Parcel.readExceptionCode(Parcel.java:1580)\n\tat android.os.Parcel.readException(Parcel.java:1549)\n\tat android.app.IWallpaperManager$Stub$Proxy.getWallpaper(IWallpaperManager.java:328)\n\tat android.app.WallpaperManager$Globals.getCurrentWallpaperLocked(WallpaperManager.java:303)\n\tat android.app.WallpaperManager$Globals.peekWallpaperBitmap(WallpaperManager.java:272)\n\tat android.app.WallpaperManager.getBitmap(WallpaperManager.java:623)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.updateWallpaperLocked(ImageWallpaper.java:428)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.drawFrame(ImageWallpaper.java:349)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.onSurfaceRedrawNeeded(ImageWallpaper.java:299)\n\tat android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:800)\n\tat android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:1196)\n\tat com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:37)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Metho","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.systemui/1569488137686/system_app_strictmode@1569488136328.txt"},{"id":91,"page":null,"limit":null,"issueType":"data_app_anr","issueProcessName":"com.pactera.test.demo","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-26 16:39:09.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-26 16:39:12.0","issueDescription":"Process: com.pactera.test.demo\nFlags: 0x38c8bf46\nPackage: com.pactera.test.demo v1 (1.0)\nActivity: com.pactera.test.demo/.MainActivity\nSubject: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago.  Wait queue length: 6.  Wait queue head age: 6108.2ms.)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\n\nCPU usage from 135409ms to 0ms ago:\n  13% 2259/perfd: 1% user + 11% kernel / faults: 1716 minor\n  12% 1270/adbd: 0.3% user + 12% kernel / faults: 29420 minor\n  11% 1611/system_server: 4.2% user + 7.4% kernel / faults: 5910 minor\n  4.8% 1255/surfaceflinger: 0.1% user + 4.6% kernel / faults: 1 minor\n  3.2% 1263/mediaserver: 0% user + 3.2% kernel / faults: 3 minor\n  0.5% 3/ksoftirqd/0: 0% user + 0.5% kernel\n  0.5% 8/rcu_preempt: 0% user + 0.5% kernel\n  0.5% 12/ksoftirqd/1: 0% user + 0.5% kernel\n  0.3% 781/kworker/u4:3: 0% user + 0.3% kernel\n  0.2% 11/migration/1: 0% user + 0.2% kernel\n  0.2% 1710/com.android.systemui: 0% user + 0.2% kernel / faults: 177 minor\n  0.2% 1254/servicemanager: 0% user + 0.2% kernel\n  0.2% 1929/com.android.phone: 0% user + 0.2% kernel / faults: 4 minor\n  0.2% 6/kworker/u4:0: 0% user + 0.2% kernel\n  0.2% 1942/com.android.launcher3: 0% user + 0.1% kernel / faults: 388 minor\n  0.1% 7/migration/0: 0% user + 0.1% kernel\n  0.1% 1996/com.pactera.asmp: 0% user + 0.1% kernel / faults: 749 minor\n  0.1% 444/kworker/0:1: 0% user + 0.1% kernel\n  0.1% 1297/logcat: 0% user + 0.1% kernel / faults: 1 minor\n  0% 1211/logd: 0% user + 0% kernel / faults: 66 minor\n  0% 660/kworker/1:1: 0% user + 0% kernel\n  0% 1252/healthd: 0% user + 0% kernel\n  0% 1261/rild: 0% user + 0% kernel\n  0% 1266/zygote: 0% user + 0% kernel / faults: 1240 minor\n  0% 1209/jbd2/vdc-8: 0% user + 0% kernel\n  0% 1269/fingerprintd: 0% user + 0% kernel\n  0% 1281/logcat: 0% user + 0% kernel / faults: 1 minor\n  0% 1912/com.android.inputmethod.latin: 0% user + 0% kernel / faults: 1 minor\n +0% 3982/kworker/1:2: 0% user + 0% kernel\n +0% 4441/com.pactera.test.demo: 0% user + 0% kernel\n36% TOTAL: 6.4% user + 28% kernel + 0% irq + 2% softirq\n\n-----","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.pactera.test.demo/1569487149337/data_app_anr@1569487148674.txt"}],
     * "code":200}
     * }
     **/
    @RequiresPermissions({PermissionCode.TRACE_MANAGEMENT})
    @PostMapping("/getIssues")
    @ResponseBody
//    @RequiresPermissions(value = "issuemanage")
    public ResponseResult getIssues(@RequestBody IssueSearchDTO issueSearchDTO) {
        int page = issueSearchDTO.getPage();
        int limit = issueSearchDTO.getLimit();

        ResponseResult responseResult = new ResponseResult(ResultCode.SUCCESS);
        PageDataResult pdr = new PageDataResult();
        try {
            if (0 == page) {
                page = 1;
            }
            if (0 == limit) {
                limit = 10;
            }
            if(page < 0 || limit < 0) {
                JSONObject jsonObject = new JSONObject();
                jsonObject.put("totals", 0);
                jsonObject.put("list", Lists.newArrayList());
                responseResult.setData(jsonObject);
                return responseResult;
            }
            pdr = mIssueService.getIssues(issueSearchDTO, page, limit);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("list", pdr.getList());
            jsonObject.put("totals", pdr.getTotals());
            responseResult.setData(jsonObject);
        } catch (Exception e) {
            logger.error("Issue列表查询异常！", e);
            responseResult = new ResponseResult(ResultCode.SYSTEM_INNER_ERROR);
        }
        return responseResult;
    }


    /**
     * @Method del
     * @Description del
     * @param: [del]
     * @return:
     * @auther: lzq
     * @date: 2019/8/2 15:03
     */
    /**
     * @api {post} /issue/delIssues delIssues
     * @apiDescription 删除选中问题
     * @apiName delIssues
     * @apiGroup Issue manage
     * @apiParamExample {json} Request-Example:
     * {
    "list":
     * [{"id":100,
     * "page":null,
     * "limit":null,
     * "issueType":"data_app_anr",
     * "issueProcessName":"com.pactera.test.demo",
     * "vinCode":"LZAAAAAAAAAAAAAA",
     * "projectName":"GEM-K257-GEM升级项目",
     * "deviceVersion":"Delphi 23.24.01.22",
     * "issueCreateTime":"2019-09-27 13:36:40.0",
     * "issueCreateTimeEnd":null,
     * "issueUploadTime":"2019-09-27 13:36:45.0",
     * "issueDescription":"Process: com.pactera.test.demo\nFlags: 0x38c8bf46\nPackage: com.pactera.test.demo v1 (1.0)\nActivity: com.pactera.test.demo/.MainActivity\nSubject: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago.  Wait queue length: 4.  Wait queue head age: 5586.4ms.)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\n\nCPU usage from 351596ms to 0ms ago:\n  14% 2331/perfd: 2% user + 12% kernel / faults: 31233 minor\n  11% 1637/system_server: 4.7% user + 6.3% kernel / faults: 15117 minor\n  7.7% 1241/adbd: 0.1% user + 7.5% kernel / faults: 62042 minor\n  2.6% 1224/surfaceflinger: 0.1% user + 2.5% kernel\n  0.5% 3/ksoftirqd/0: 0% user + 0.5% kernel\n  0.3% 12/ksoftirqd/1: 0% user + 0.3% kernel\n  0.3% 8/rcu_preempt: 0% user + 0.3% kernel\n  0.2% 1232/mediaserver: 0% user + 0.2% kernel / faults: 4 minor\n  0.2% 11/migration/1: 0% user + 0.2% kernel\n  0.1% 19870/kworker/u4:1: 0% user + 0.1% kernel\n  0.1% 26765/kworker/u4:0: 0% user + 0.1% kernel\n  0.1% 7/migration/0: 0% user + 0.1% kernel\n  0.1% 1950/com.android.phone: 0% user + 0.1% kernel / faults: 6 minor\n  0.1% 1223/servicemanager: 0% user + 0.1% kernel\n  0.1% 1964/com.android.launcher3: 0% user + 0% kernel / faults: 378 minor\n  0% 1747/com.android.systemui: 0% user + 0% kernel / faults: 14 minor\n  0% 1221/healthd: 0% user + 0% kernel\n  0% 2624/kworker/1:2: 0% user + 0% kernel\n  0% 31083/kworker/0:0: 0% user + 0% kernel\n  0% 1211/logd: 0% user + 0% kernel / faults: 6 minor\n  0% 1230/rild: 0% user + 0% kernel\n  0% 1240/fingerprintd: 0% user + 0% kernel\n  0% 1228/netd: 0% user + 0% kernel / faults: 15 minor\n  0% 1242/logcat: 0% user + 0% kernel\n  0% 1897/com.android.inputmethod.latin: 0% user + 0% kernel / faults: 1 minor\n +0% 2140/com.pactera.test.demo: 0% user + 0% kernel\n27% TOTAL: 6% user + 20% kernel + 0% irq + 0.9% softirq\n\n----- pid 2140 at 2019-09-27 05:36:37 -----\nCmd line: com.pactera.test.demo\nBuild fingerprint: 'Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys'\nABI: 'x86'\nBuild type: optimized\nZygote loaded classes=3978 post zygote classes=258\nIntern ","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.pactera.test.demo/1569562600196/data_app_anr@1569562599689.txt"},{"id":99,"page":null,"limit":null,"issueType":"data_app_crash","issueProcessName":"com.pactera.test.demo","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 13:28:12.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 13:28:17.0","issueDescription":"Process: com.pactera.test.demo\nFlags: 0x38c8bf46\nPackage: com.pactera.test.demo v1 (1.0)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\n\njava.lang.IllegalStateException: Could not execute method for android:onClick\n\tat android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)\n\tat android.view.View.performClick(View.java:5198)\n\tat android.view.View$PerformClick.run(View.java:21147)\n\tat android.os.Handler.handleCallback(Handler.java:739)\n\tat android.os.Handler.dispatchMessage(Handler.java:95)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\nCaused by: java.lang.reflect.InvocationTargetException\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)\n\t... 9 more\nCaused by: java.lang.ArithmeticException: divide by zero\n\tat com.pactera.test.demo.MainActivity.onClickFunction(MainActivity.java:44)\n\t... 11 more\n","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.pactera.test.demo/1569562092230/data_app_crash@1569562090974.txt"},{"id":98,"page":null,"limit":null,"issueType":"data_app_crash","issueProcessName":"com.pactera.test.demo","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:18:08.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:18:10.0","issueDescription":"Process: com.pactera.test.demo\nFlags: 0x38c8bf46\nPackage: com.pactera.test.demo v1 (1.0)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\n\njava.lang.IllegalStateException: Could not execute method for android:onClick\n\tat android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)\n\tat android.view.View.performClick(View.java:5198)\n\tat android.view.View$PerformClick.run(View.java:21147)\n\tat android.os.Handler.handleCallback(Handler.java:739)\n\tat android.os.Handler.dispatchMessage(Handler.java:95)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\nCaused by: java.lang.reflect.InvocationTargetException\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)\n\t... 9 more\nCaused by: java.lang.ArithmeticException: divide by zero\n\tat com.pactera.test.demo.MainActivity.onClickFunction(MainActivity.java:44)\n\t... 11 more\n","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.pactera.test.demo/1569557888135/data_app_crash@1569557886817.txt"},{"id":97,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.settings","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:16:59.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:17:00.0","issueDescription":"Process: com.android.settings\nFlags: 0x30c83e45\nPackage: com.android.settings v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 137843\nLoop-Violation-Number: 1\nDuration-Millis: 726\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=2621447 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)\n\tat java.io.File.doAccess(File.java:281)\n\tat java.io.File.exists(File.java:361)\n\tat android.app.ContextImpl.createFilesDirLocked(ContextImpl.java:418)\n\tat android.app.ContextImpl.getFilesDir(ContextImpl.java:441)\n\tat android.content.ContextWrapper.getFilesDir(ContextWrapper.java:203)\n\tat com.android.settings.Utils.isLowStorage(Utils.java:1077)\n\tat com.android.settings.SettingsActivity.onCreate(SettingsActivity.java:589)\n\tat android.app.Activity.performCreate(Activity.java:6237)\n\tat android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)\n\tat android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)\n\tat android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)\n\tat android.app.ActivityThread.-wrap11(ActivityThread.java)\n\tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\n\nProcess: com.android.settings\nFlags: 0x30c83e45\nPackage: com.android.settings v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 137844\nLoop-Violation-Number: 2\nDuration-Millis: 725\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=2621447 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.statvfs(BlockGuardOs.java:297)\n\tat java.io.F","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.settings/1569557818965/system_app_strictmode@1569557818444.txt"},{"id":96,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.systemui","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:16:12.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:16:13.0","issueDescription":"Process: com.android.systemui\nFlags: 0x38c83e0d\nPackage: com.android.systemui v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 91263\nLoop-Violation-Number: 1\nDuration-Millis: 584\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=6815751 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)\n\tat java.io.File.doAccess(File.java:281)\n\tat java.io.File.exists(File.java:361)\n\tat com.android.server.wallpaper.WallpaperManagerService.getWallpaper(WallpaperManagerService.java:828)\n\tat android.app.IWallpaperManager$Stub.onTransact(IWallpaperManager.java:101)\n\tat android.os.Binder.execTransact(Binder.java:453)\n# via Binder call with stack:\nandroid.os.StrictMode$LogStackTrace\n\tat android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1911)\n\tat android.os.Parcel.readExceptionCode(Parcel.java:1580)\n\tat android.os.Parcel.readException(Parcel.java:1549)\n\tat android.app.IWallpaperManager$Stub$Proxy.getWallpaper(IWallpaperManager.java:328)\n\tat android.app.WallpaperManager$Globals.getCurrentWallpaperLocked(WallpaperManager.java:303)\n\tat android.app.WallpaperManager$Globals.peekWallpaperBitmap(WallpaperManager.java:272)\n\tat android.app.WallpaperManager.getBitmap(WallpaperManager.java:623)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.updateWallpaperLocked(ImageWallpaper.java:428)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.drawFrame(ImageWallpaper.java:349)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.onSurfaceRedrawNeeded(ImageWallpaper.java:299)\n\tat android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:800)\n\tat android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:1196)\n\tat com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:37)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\n\n","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.systemui/1569557772154/system_app_strictmode@1569557771717.txt"},{"id":95,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.providers.telephony","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:16:01.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:16:02.0","issueDescription":"Process: com.android.phone\nFlags: 0x38c83e4d\nPackage: com.android.providers.telephony v23 (6.0-4174734)\nPackage: com.android.phone v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 81144\nLoop-Violation-Number: 1\nBroadcast-Intent-Action: android.telephony.action.CARRIER_CONFIG_CHANGED\nDuration-Millis: 29\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=2621447 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)\n\tat java.io.File.doAccess(File.java:281)\n\tat java.io.File.exists(File.java:361)\n\tat android.app.SharedPreferencesImpl.writeToFile(SharedPreferencesImpl.java:570)\n\tat android.app.SharedPreferencesImpl.-wrap2(SharedPreferencesImpl.java)\n\tat android.app.SharedPreferencesImpl$2.run(SharedPreferencesImpl.java:515)\n\tat android.app.SharedPreferencesImpl.enqueueDiskWrite(SharedPreferencesImpl.java:536)\n\tat android.app.SharedPreferencesImpl.-wrap0(SharedPreferencesImpl.java)\n\tat android.app.SharedPreferencesImpl$EditorImpl.commit(SharedPreferencesImpl.java:458)\n\tat com.android.phone.settings.VisualVoicemailSettingsUtil.setVisualVoicemailEnabled(VisualVoicemailSettingsUtil.java:68)\n\tat com.android.phone.vvm.omtp.SimChangeReceiver.onReceive(SimChangeReceiver.java:87)\n\tat android.app.ActivityThread.handleReceiver(ActivityThread.java:2725)\n\tat android.app.ActivityThread.-wrap14(ActivityThread.java)\n\tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\n\nProcess: com.android.phone\nFlags: 0x38c83e4d\nPackage: com.android.providers.telephony v23 (6.0-4174734)\nPackage: com.android.phone v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Mil","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.providers.telephony/1569557761117/system_app_strictmode@1569557760589.txt"},{"id":94,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.deskclock","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:15:54.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:15:57.0","issueDescription":"Process: com.android.deskclock\nFlags: 0x3cc9be45\nPackage: com.android.deskclock v410 (4.1.0)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 75982\nLoop-Violation-Number: 1\nBroadcast-Intent-Action: android.intent.action.BOOT_COMPLETED\nDuration-Millis: 148\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=2621447 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)\n\tat java.io.File.doAccess(File.java:281)\n\tat java.io.File.exists(File.java:361)\n\tat android.app.SharedPreferencesImpl.writeToFile(SharedPreferencesImpl.java:570)\n\tat android.app.SharedPreferencesImpl.-wrap2(SharedPreferencesImpl.java)\n\tat android.app.SharedPreferencesImpl$2.run(SharedPreferencesImpl.java:515)\n\tat android.app.SharedPreferencesImpl.enqueueDiskWrite(SharedPreferencesImpl.java:536)\n\tat android.app.SharedPreferencesImpl.-wrap0(SharedPreferencesImpl.java)\n\tat android.app.SharedPreferencesImpl$EditorImpl.commit(SharedPreferencesImpl.java:458)\n\tat com.android.deskclock.alarms.AlarmStateManager.updateGlobalIntentId(AlarmStateManager.java:168)\n\tat com.android.deskclock.AlarmInitReceiver.onReceive(AlarmInitReceiver.java:57)\n\tat android.app.ActivityThread.handleReceiver(ActivityThread.java:2725)\n\tat android.app.ActivityThread.-wrap14(ActivityThread.java)\n\tat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)\n\nProcess: com.android.deskclock\nFlags: 0x3cc9be45\nPackage: com.android.deskclock v410 (4.1.0)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 75987\nLoop-Violation-Number: 2\nBroadcast-Intent-Action: android.intent.action.BOOT_COMPLETED\nDuration-Millis: 143\n\nandroid.os.StrictMode$StrictM","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.deskclock/1569557754489/system_app_strictmode@1569557753847.txt"},{"id":93,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.providers.telephony","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-27 12:15:52.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-27 12:15:55.0","issueDescription":"Process: com.android.phone\nFlags: 0x38c83e4d\nPackage: com.android.providers.telephony v23 (6.0-4174734)\nPackage: com.android.phone v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 74326\nLoop-Violation-Number: 1\nDuration-Millis: 130\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=2621447 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat android.database.sqlite.SQLiteConnection.applyBlockGuardPolicy(SQLiteConnection.java:1039)\n\tat android.database.sqlite.SQLiteConnection.executeForCursorWindow(SQLiteConnection.java:840)\n\tat android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:836)\n\tat android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62)\n\tat android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:143)\n\tat android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132)\n\tat android.content.ContentResolver.query(ContentResolver.java:510)\n\tat android.content.ContentResolver.query(ContentResolver.java:434)\n\tat com.android.internal.telephony.SubscriptionController.getSubInfo(SubscriptionController.java:332)\n\tat com.android.internal.telephony.SubscriptionController.getActiveSubscriptionInfoList(SubscriptionController.java:556)\n\tat com.android.internal.telephony.SubscriptionController.getActiveSubscriptionInfo(SubscriptionController.java:401)\n\tat android.telephony.SubscriptionManager.getActiveSubscriptionInfo(SubscriptionManager.java:476)\n\tat com.android.services.telephony.TelecomAccountRegistry$AccountEntry.registerPstnPhoneAccount(TelecomAccountRegistry.java:120)\n\tat com.android.services.telephony.TelecomAccountRegistry$AccountEntry.<init>(TelecomAccountRegistry.java:75)\n\tat com.android.services.telephony.TelecomAccountRegistry.setupAccounts(TelecomAccountRegistry.java:399)\n\tat com.android.services.telephony.TelecomAccountRegistry.-wrap0(TelecomAccountRegistry.java)\n\tat com.android.services.telephony.TelecomAccountRegistry$1.onSubscriptionsChanged(TelecomAccountRegistry.java:271)\n\tat android.telephony.SubscriptionManager$OnSubscriptionsChangedListener$1.handleMessage(Subsc","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.providers.telephony/1569557751554/system_app_strictmode@1569557750689.txt"},{"id":92,"page":null,"limit":null,"issueType":"system_app_strictmode","issueProcessName":"com.android.systemui","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-26 16:55:38.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-26 16:55:48.0","issueDescription":"Process: com.android.systemui\nFlags: 0x38c83e0d\nPackage: com.android.systemui v23 (6.0-4174734)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\nSystem-App: true\nUptime-Millis: 1386908\nLoop-Violation-Number: 1\nDuration-Millis: 532\n\nandroid.os.StrictMode$StrictModeDiskReadViolation: policy=6815751 violation=2\n\tat android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1263)\n\tat libcore.io.BlockGuardOs.access(BlockGuardOs.java:67)\n\tat java.io.File.doAccess(File.java:281)\n\tat java.io.File.exists(File.java:361)\n\tat com.android.server.wallpaper.WallpaperManagerService.getWallpaper(WallpaperManagerService.java:828)\n\tat android.app.IWallpaperManager$Stub.onTransact(IWallpaperManager.java:101)\n\tat android.os.Binder.execTransact(Binder.java:453)\n# via Binder call with stack:\nandroid.os.StrictMode$LogStackTrace\n\tat android.os.StrictMode.readAndHandleBinderCallViolations(StrictMode.java:1911)\n\tat android.os.Parcel.readExceptionCode(Parcel.java:1580)\n\tat android.os.Parcel.readException(Parcel.java:1549)\n\tat android.app.IWallpaperManager$Stub$Proxy.getWallpaper(IWallpaperManager.java:328)\n\tat android.app.WallpaperManager$Globals.getCurrentWallpaperLocked(WallpaperManager.java:303)\n\tat android.app.WallpaperManager$Globals.peekWallpaperBitmap(WallpaperManager.java:272)\n\tat android.app.WallpaperManager.getBitmap(WallpaperManager.java:623)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.updateWallpaperLocked(ImageWallpaper.java:428)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.drawFrame(ImageWallpaper.java:349)\n\tat com.android.systemui.ImageWallpaper$DrawableEngine.onSurfaceRedrawNeeded(ImageWallpaper.java:299)\n\tat android.service.wallpaper.WallpaperService$Engine.updateSurface(WallpaperService.java:800)\n\tat android.service.wallpaper.WallpaperService$IWallpaperEngineWrapper.executeMessage(WallpaperService.java:1196)\n\tat com.android.internal.os.HandlerCaller$MyHandler.handleMessage(HandlerCaller.java:37)\n\tat android.os.Handler.dispatchMessage(Handler.java:102)\n\tat android.os.Looper.loop(Looper.java:148)\n\tat android.app.ActivityThread.main(ActivityThread.java:5417)\n\tat java.lang.reflect.Method.invoke(Native Metho","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.android.systemui/1569488137686/system_app_strictmode@1569488136328.txt"},{"id":91,"page":null,"limit":null,"issueType":"data_app_anr","issueProcessName":"com.pactera.test.demo","vinCode":"LZAAAAAAAAAAAAAA","projectName":"GEM-K257-GEM升级项目","deviceVersion":"Delphi 23.24.01.22","issueCreateTime":"2019-09-26 16:39:09.0","issueCreateTimeEnd":null,"issueUploadTime":"2019-09-26 16:39:12.0","issueDescription":"Process: com.pactera.test.demo\nFlags: 0x38c8bf46\nPackage: com.pactera.test.demo v1 (1.0)\nActivity: com.pactera.test.demo/.MainActivity\nSubject: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago.  Wait queue length: 6.  Wait queue head age: 6108.2ms.)\nBuild: Android/sdk_phone_x86/generic_x86:6.0/MASTER/4174734:userdebug/test-keys\n\nCPU usage from 135409ms to 0ms ago:\n  13% 2259/perfd: 1% user + 11% kernel / faults: 1716 minor\n  12% 1270/adbd: 0.3% user + 12% kernel / faults: 29420 minor\n  11% 1611/system_server: 4.2% user + 7.4% kernel / faults: 5910 minor\n  4.8% 1255/surfaceflinger: 0.1% user + 4.6% kernel / faults: 1 minor\n  3.2% 1263/mediaserver: 0% user + 3.2% kernel / faults: 3 minor\n  0.5% 3/ksoftirqd/0: 0% user + 0.5% kernel\n  0.5% 8/rcu_preempt: 0% user + 0.5% kernel\n  0.5% 12/ksoftirqd/1: 0% user + 0.5% kernel\n  0.3% 781/kworker/u4:3: 0% user + 0.3% kernel\n  0.2% 11/migration/1: 0% user + 0.2% kernel\n  0.2% 1710/com.android.systemui: 0% user + 0.2% kernel / faults: 177 minor\n  0.2% 1254/servicemanager: 0% user + 0.2% kernel\n  0.2% 1929/com.android.phone: 0% user + 0.2% kernel / faults: 4 minor\n  0.2% 6/kworker/u4:0: 0% user + 0.2% kernel\n  0.2% 1942/com.android.launcher3: 0% user + 0.1% kernel / faults: 388 minor\n  0.1% 7/migration/0: 0% user + 0.1% kernel\n  0.1% 1996/com.pactera.asmp: 0% user + 0.1% kernel / faults: 749 minor\n  0.1% 444/kworker/0:1: 0% user + 0.1% kernel\n  0.1% 1297/logcat: 0% user + 0.1% kernel / faults: 1 minor\n  0% 1211/logd: 0% user + 0% kernel / faults: 66 minor\n  0% 660/kworker/1:1: 0% user + 0% kernel\n  0% 1252/healthd: 0% user + 0% kernel\n  0% 1261/rild: 0% user + 0% kernel\n  0% 1266/zygote: 0% user + 0% kernel / faults: 1240 minor\n  0% 1209/jbd2/vdc-8: 0% user + 0% kernel\n  0% 1269/fingerprintd: 0% user + 0% kernel\n  0% 1281/logcat: 0% user + 0% kernel / faults: 1 minor\n  0% 1912/com.android.inputmethod.latin: 0% user + 0% kernel / faults: 1 minor\n +0% 3982/kworker/1:2: 0% user + 0% kernel\n +0% 4441/com.pactera.test.demo: 0% user + 0% kernel\n36% TOTAL: 6.4% user + 28% kernel + 0% irq + 2% softirq\n\n-----","tracePath":"E:/asmp_project/uplaod/GEM-K257-GEM升级项目/com.pactera.test.demo/1569487149337/data_app_anr@1569487148674.txt"}],
     * }
     * @apiSuccessExample Success-Response:
     * {
     *  "删除成功"
     * }
     **/
    @RequiresPermissions({PermissionCode.TRACE_MANAGEMENT})
    @PostMapping("/delIssues")
    @ResponseBody
    public ResponseResult delIssues(@RequestBody JSONObject jsonParam) {
        ResponseResult responseResult;
        logger.debug("删除Issue--datas-  {}" , jsonParam);
        List<Integer> listData = (List<Integer>) jsonParam.get("issues");
        try {
            if (!listData.isEmpty()) {
                String msg = mIssueService.delIssues(listData);
                if(ResultCode.SUCCESS.message().equals(msg)){
                    responseResult = new ResponseResult(ResultCode.SUCCESS);
                }else {
                    responseResult = new ResponseResult(ResultCode.FAIL);
                }
            } else {
                responseResult = new ResponseResult(ResultCode.PARAM_IS_BLANK);
            }
        } catch (Exception e) {
            logger.error("删除Issue异常！", e);
            responseResult = new ResponseResult(ResultCode.SYSTEM_INNER_ERROR);
            responseResult.setMessage("删除Issue异常！");
        }
        return responseResult;
    }


    /**
     * @Method issueList
     * @Description issueList
     * @return: "/issue/issueList"
     * @auther: lzq
     * @date: 2019/8/2 15:41
     */
    @GetMapping("/issueList")
    public String issueList(){
        return "/issue/issueList";
    }


    /**
     * @Method getChartData
     * @Description 查询饼图数据
     * @param:
     * @return:pieChart
     * @auther:
     * @date:
     */
    /**
     * @api {post} /issue/getChartData getChartData
     * @apiDescription 根据项目名称，显示四类问题的个数，填充饼图数据
     * @apiName getChartData
     * @apiGroup Trend manage
     * @apiParamExample {json} Request-Example:
     * {
     * projectName: GEM
     * }
     * @apiSuccessExample Success-Response:
     * {
     * {"anr":22,"crash":3,"other":0,"tombstone":11}
     * }
     **/
    @PostMapping("/getChartData")
    @ResponseBody
    public ResponseResult getChartData(@RequestBody JSONObject jsonParms) {
        ResponseResult responseResult;
        String projectName = jsonParms.getString("projectName");
        if(StringUtils.isEmpty(projectName)){
            responseResult = new ResponseResult(ResultCode.PARAM_IS_BLANK);
        }else {
            PieChart pieChart = mIssueService.getChartData(projectName);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("list",pieChart);
            responseResult = new ResponseResult(ResultCode.SUCCESS);
            responseResult.setData(pieChart);
        }

        return responseResult;
    }

    /**
     * @Method getProblemCount
     * @Description 查询饼图数据
     * @param:
     * @return:pieChart
     * @auther:
     * @date:
     */
    /**
     * @api {post} /issue/getProblemCount getProblemCount
     * @apiDescription 根据项目名称以及版本名称，显示四类问题的数目
     * @apiName getProblemCount
     * @apiGroup Trend manage
     * @apiParamExample {json} Request-Example:
     * {
     * projectName: GEM
     * versionData[]: Delphi:24.36.22.32
     * versionData[]: Delphi:23.36.22.32
     * versionData[]: Delphi:21.36.22.32
     * }
     * @apiSuccessExample Success-Response:
     * {
     *     "Delphi:21.36.22.32":{
     *         "anr":8,
     *         "crash":1,
     *         "other":0,
     *         "tombstone":3
     *     },
     *     "Delphi:24.36.22.32":{
     *         "anr":3,
     *         "crash":0,
     *         "other":0,
     *         "tombstone":3
     *     },
     *     "Delphi:23.36.22.32":{
     *         "anr":2,
     *         "crash":1,
     *         "other":0,
     *         "tombstone":2
     *     }
     * }
     **/
    @PostMapping("/getProblemCount")
    @ResponseBody
    public ResponseResult getProblemCount(@RequestBody JSONObject jsonParams) {
        ResponseResult responseResult;
        String projectName = jsonParams.getString("projectName");
        List<String> versionData = (List<String>) jsonParams.get("versionData");
        if(StringUtils.isEmpty(projectName) || CollectionUtils.isEmpty(versionData)){
            responseResult = new ResponseResult(ResultCode.PARAM_IS_BLANK);
            return responseResult;
        }
        List<PieChartVO> result = new ArrayList<>();

        try {
            for(String version : versionData){
                PieChart pieChart = mIssueService.getProblemCount(projectName, version);
                PieChartVO pieChartVo = new PieChartVO();
                pieChartVo.setVersion(version);
                pieChartVo.setAnr(pieChart.getANR());
                pieChartVo.setCrash(pieChart.getCRASH());
                pieChartVo.setOther(pieChart.getOTHER());
                pieChartVo.setTombstone(pieChart.getTOMBSTONE());
                result.add(pieChartVo);
            }
        }catch (Exception e){
            responseResult = new ResponseResult(ResultCode.SYSTEM_INNER_ERROR);
            return responseResult;
        }
        responseResult = new ResponseResult(ResultCode.SUCCESS);
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("list", result);
        responseResult.setData(jsonObject);
        return responseResult;
    }

}
